*** Settings ***
Documentation     测试过滤出一个产品的情况
Library           SeleniumLibrary
Test Setup     Open Browser To List Products
Test Teardown     Close Browser

*** Variables ***
${SERVER}         http://localhost:8081/
${BROWSER}        edge

*** Test Cases ***
过滤出第一个产品
    Input Key To Look for     Gem
    Should Have Product Name    Gem Visa
过滤出第二个产品
    Input Key To Look for    Degrees
    Should Have Product Name    28 Degrees
过滤出第三个产品
    Input Key To Look for    My
    Should Have Product Name    MyFlexiPay

*** Keywords ***
Open Browser To List Products
    Open Browser    ${SERVER}    ${BROWSER}
    Title Should Be    consumer
Input Key To Look for
    [Arguments]    ${key}
    Set Focus To Element    xpath:/html/body/div/div/div[1]/div/input
    Press Keys    xpath:/html/body/div/div/div[1]/div/input    ${key}
Should Have Product Name
    [Arguments]    ${name}
    Table Row Should Contain    xpath:/html/body/div/div/div[2]/div[1]/div[2]/table    1   ${name}
